package org.miniframework.mvc.render;

import org.miniframework.mvc.RequestProcessorChain;

import javax.servlet.http.HttpServletResponse;

/**
 * 内部异常渲染器
 */
public class InternalErrorResultRender implements ResultRender{

    private String errorMessage;

    public InternalErrorResultRender(String errorMessage){
        this.errorMessage = errorMessage;
    }

    @Override
    public void render(RequestProcessorChain chain) throws Exception {
        chain.getResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,this.errorMessage);
    }
}
